package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * MessageContent generated by hbm2java
 */
@Entity
@Table(name = "message_content")
public class MessageContent implements java.io.Serializable {

	private Long id;
	private UserBaseInfo userBaseInfoByToUserId;
	private UserBaseInfo userBaseInfoByFromUserId;
	private String content;
	private Date sendTime;
	private boolean readFlag;
	private String redirectUrl;

	public MessageContent() {
	}

	public MessageContent(UserBaseInfo userBaseInfoByToUserId,
			UserBaseInfo userBaseInfoByFromUserId, Date sendTime,
			boolean readFlag) {
		this.userBaseInfoByToUserId = userBaseInfoByToUserId;
		this.userBaseInfoByFromUserId = userBaseInfoByFromUserId;
		this.sendTime = sendTime;
		this.readFlag = readFlag;
	}

	public MessageContent(UserBaseInfo userBaseInfoByToUserId,
			UserBaseInfo userBaseInfoByFromUserId, String content,
			Date sendTime, boolean readFlag, String redirectUrl) {
		this.userBaseInfoByToUserId = userBaseInfoByToUserId;
		this.userBaseInfoByFromUserId = userBaseInfoByFromUserId;
		this.content = content;
		this.sendTime = sendTime;
		this.readFlag = readFlag;
		this.redirectUrl = redirectUrl;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TO_USER_ID", nullable = false)
	public UserBaseInfo getUserBaseInfoByToUserId() {
		return this.userBaseInfoByToUserId;
	}

	public void setUserBaseInfoByToUserId(UserBaseInfo userBaseInfoByToUserId) {
		this.userBaseInfoByToUserId = userBaseInfoByToUserId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FROM_USER_ID", nullable = false)
	public UserBaseInfo getUserBaseInfoByFromUserId() {
		return this.userBaseInfoByFromUserId;
	}

	public void setUserBaseInfoByFromUserId(
			UserBaseInfo userBaseInfoByFromUserId) {
		this.userBaseInfoByFromUserId = userBaseInfoByFromUserId;
	}

	@Column(name = "CONTENT", length = 65535)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "SEND_TIME", nullable = false, length = 19)
	public Date getSendTime() {
		return this.sendTime;
	}

	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}

	@Column(name = "READ_FLAG", nullable = false)
	public boolean isReadFlag() {
		return this.readFlag;
	}

	public void setReadFlag(boolean readFlag) {
		this.readFlag = readFlag;
	}

	@Column(name = "REDIRECT_URL", length = 500)
	public String getRedirectUrl() {
		return this.redirectUrl;
	}

	public void setRedirectUrl(String redirectUrl) {
		this.redirectUrl = redirectUrl;
	}

}
